﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace JXT.PrimaryKey.Batman.Core.Configuration
{
    /// <summary>
    /// Memcached服务器配置节点
    /// </summary>
    public class MemcachedSettingConfigurationElement : ConfigurationElement
    {
        public MemcachedSettingConfigurationElement()
        {
        }

        /// <summary>
        /// 服务器名称
        /// </summary>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get { return this["name"] as string; }
            set { this["name"] = value; }
        }

        /// <summary>
        /// 服务器IP
        /// </summary>
        [ConfigurationProperty("ip", IsRequired = true)]
        public string Ip
        {
            get { return this["ip"] as string; }
            set { this["ip"] = value; }
        }

        /// <summary>
        /// 服务器端口
        /// </summary>
        [ConfigurationProperty("port", IsRequired = false)]
        public uint Port
        {
            get { return (uint)this["port"]; }
            set { this["port"] = value; }
        }
    }
}
